<div role=main class=container_12 id=content-wrapper>
        <div id=main_content>
                <h2 class=grid_12>
                        Daftar Proyek
                </h2>
                <div class=clear>
                </div>
                <div class=grid_12>
                        <div class=box>

							<?php if (empty($daftar_proyek)) { ?>
							<div class="alert warning">
									<span class="icon">
									</span>
									<span class="hide">
											x
									</span>
									<strong>
											Warning
									</strong>
									Proyek belum ada
							</div>
							<?php } else {?>
							<div class="header">
								<img width="16" height="16" src="<?= base_url() ?>img/icons/packs/fugue/16x16/shadeless/table-excel.png"/>
								<h3>Daftar Proyek</h3>
								<span>
								</span>
							</div>
							<div class=content>
								<table id=table-example class=table>
									<thead>
										<tr>
											<th style="width: 10px">
													No.
											</th>
											<th>
													Nama Proyek
											</th>
											<th>
													Pemilik Proyek
											</th>
											<th>
													Tanggal Mulai
											</th>
											<th>
													Tanggal Deadline
											</th>
											<th>
													Status
											</th>
												 <?php if (strcmp($this->session->userdata('jabatan'), "Admin") != 0) {?>
											<th style="width: 30px">
													Lihat
											</th>
											<?php }?>
											<?php if ( (strcmp($this->session->userdata('jabatan'), "Admin") == 0) ||
													   (strcmp($this->session->userdata('jabatan'), "Sekretaris")  == 0) ||
													   (strcmp($this->session->userdata('jabatan'), "Direktur utama") == 0) ||
													   (strcmp($this->session->userdata('jabatan'), "Direktur teknik") == 0) ) {?>
											<th style="width: 30px">
													Edit
											</th>
											<th style="width: 30px">
													Hapus
											</th>
											<?php }?>
										</tr>
									</thead>
									<tbody>
										<?php
											$i = 1;
											foreach ($daftar_proyek as $row) {
													?>
											<tr class="<?php
											if ($i % 2 == 0) {
													echo 'gradeU even';
											} else {
													echo 'gradeU odd';
											} ?>">
											<td>
													<?= $i?>
											</td>
											<td>
													<?= $row['nama_proyek'] ?>
											</td>
											<td>
													<?= $row['pemilik_proyek'] ?>
											</td>
											<td>
													<?= $row['tanggal_mulai'] ?>
											</td>
											<td class=center>
													<?= $row['tanggal_deadline'] ?>
											</td>
											<td class=center>
													<?= $row['status'] ?>
											</td>
											<?php if (strcmp($this->session->userdata('jabatan'), "Admin") != 0) {?>
											<td style="width: 30px">
													<a class="button" href="<?= site_url("utama/view_proyek/".url_title($row['nama_proyek']))?>">Lihat</a>
											</td>
											<?php }?>
											<?php if ((( (strcmp($this->session->userdata('jabatan'), "Admin") == 0)) ||
																 (((strcmp($this->session->userdata('jabatan'), "Sekretaris")  == 0) )) ||
																 ((strcmp($this->session->userdata('jabatan'), "Direktur utama") == 0)) ||
																 (strcmp($this->session->userdata('Direktur teknik'), "Direktur utama") == 0) )) {?>
											<td style="width: 30px">
													<a class="button" href="<?= base_url() ?>utama/update_proyek/<?= $row['idRuangProyek'] ?>">Edit</a>
											</td>
											<td style="width: 30px">
													<a class="button" href="<?= base_url() ?>utama/delete_proyek/<?= $row['idRuangProyek'] ?>">Hapus</a>
											</td>
											<?php }?>
										</tr>
										<?php $i++; }?>
									</tbody>
								</table>
							</div>
							<?php }?>
							<div class=clear>
							</div>
                        </div>
                </div>
                <div class=clean>
                </div>
        </div>
        <div class=clean>
        </div>
</div>
<div class=clear>
</div>
<script type="text/javascript">
        $(window).load(function() {
                $("#table-example").dataTable();
                $(window).resize()
        });
</script>
